var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
    })(e, t);
}, function(e, t) {
    function n() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, 
    new n());
}), a = this && this.__decorate || function(e, t, o, n) {
    var i, a = arguments.length, r = a < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, o, n); else for (var c = e.length - 1; 0 <= c; c--) (i = e[c]) && (r = (a < 3 ? i(r) : 3 < a ? i(t, o, r) : i(t, o)) || r);
    return 3 < a && r && Object.defineProperty(t, o, r), r;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("PrefabView"), s = e("VideoHotView"), c = e("VideoNewView"), l = e("VideoRankView"), d = e("AudioManager"), u = e("RecorderManager"), p = e("GameConfig"), h = e("WebManager"), f = e("UIManager"), g = cc._decorator, m = g.ccclass, y = g.property, v = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.hot = null, e.new = null, e.rank = null, e.nodes = null, e.tips = null, 
        e.isRecorder = !1, e;
    }
    return i(e, t), e.prototype.onClickBack = function() {
        d.default.getInstance().playAudio("按钮2"), h.default.getInstance().sentLog("点击视频排行界面返回按键"), 
        f.default.getInstance().viewMap.has("account") || f.default.getInstance().showPnl("start"), 
        this.hidePnl();
    }, e.prototype.onClickToggle = function(e) {
        var o = e.node.getSiblingIndex();
        this.nodes.children.forEach(function(e, t) {
            return e.active = t == o;
        });
    }, e.prototype.onClickRecorder = function() {
        var n = this;
        d.default.getInstance().playAudio("按钮2"), h.default.getInstance().sentLog("TryShareVideo"), 
        GA.isByteDance() && !this.isRecorder && (this.isRecorder = !0, cc.game.pause(), 
        u.default.getInstance().videoPath ? GA.PA.shareAppMessage({
            channel: "video",
            title: "我就要吃鸡",
            desc: "进入吃鸡的世界",
            imageUrl: "",
            templateId: "3eld33adx4d3bk46j6",
            query: "krq_wjycj=10002",
            extra: {
                videoPath: u.default.getInstance().videoPath,
                videoTopics: [ "我就要吃鸡", "卡日曲游戏" ],
                withVideoId: !0,
                createChallenge: !1
            },
            success: function(e) {
                cc.game.resume(), h.default.getInstance().sentLog("ShareVideoSuccess"), n.isRecorder = !1, 
                e.videoId && h.default.getInstance().saveVideoId({
                    aliasId: e.videoId,
                    success: function(e) {
                        var t;
                        console.log("保存视频成功:", e), null === (e = null === (t = GA.PA) || void 0 === t ? void 0 : t.showToast) || void 0 === e || e.call(t, {
                            title: "视频上传成功",
                            icon: "none"
                        });
                    }
                }), console.log("分享视频成功:", e);
            },
            fail: function(e) {
                var t, o;
                cc.game.resume(), h.default.getInstance().sentLog("ShareVideoFailed"), n.isRecorder = !1, 
                "shareAppMessage:cancel" == e.errMsg || "shareAppMessage:fail video duration is too short" == e.errMsg && (null === (o = null === (t = GA.PA) || void 0 === t ? void 0 : t.showToast) || void 0 === o || o.call(t, {
                    title: "抱歉,录屏时间太短！",
                    icon: "none"
                })), console.log("分享视频失败:", e);
            }
        }) : (cc.game.resume(), this.isRecorder = !1, this.tips.active = !0));
    }, e.prototype.start = function() {
        f.default.getInstance().hidePnl("start"), this.init();
    }, e.prototype.init = function() {
        this.hot.init(), this.new.init(), this.rank.init(p.GC.videoLikeList);
    }, a([ y(s.default) ], e.prototype, "hot", void 0), a([ y(c.default) ], e.prototype, "new", void 0), 
    a([ y(l.default) ], e.prototype, "rank", void 0), a([ y(cc.Node) ], e.prototype, "nodes", void 0), 
    a([ y(cc.Node) ], e.prototype, "tips", void 0), a([ m ], e);
}(r.default);

n.default = v;